#ifndef UI_MESSAGE_HANDLER_H
#define UI_MESSAGE_HANDLER_H

#include "ui_message.h"

#ifdef __cplusplus
extern "C" {
#endif



// 初始化全局消息队列系统
void ui_message_system_init(size_t queue_capacity);

// 销毁全局消息队列系统
void ui_message_system_destroy();

// 处理所有待处理消息
void ui_message_process_all();

// 线程安全的UI操作API
void safe_label_set_text(lv_obj_t* label, const char* text);
void safe_obj_add_style(lv_obj_t* obj, lv_style_t* style, lv_part_t part, lv_state_t state);
void safe_async_call(void (*callback)(void*), void* user_data);

ThreadSafeUIMessageQueue* get_ui_message_queue(void);

void safe_update_temperature(lv_obj_t* target, const char* temp_value);


#ifdef __cplusplus
}
#endif

#endif // UI_MESSAGE_HANDLER_H